package com.szc.demo01.pojo.dto;

import com.szc.demo01.pojo.Dept;
import com.szc.demo01.pojo.Emp;
import com.szc.demo01.pojo.User;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @Author: ShiZhiCheng
 * @Date: 2021/01/13 09:03:59
 */

@Data
@NoArgsConstructor
public class UserDto {

    public UserDto(User user, Emp emp, Dept dept){
        this.id = user.getId();
        this.username = user.getUsername();
        this.password = user.getPassword();
        this.email = user.getEmail();
        this.tel = user.getTel();
        this.address = user.getAddress();
        this.ename = emp.getEname();
        this.mgr = emp.getMgr();
        this.hiredate = emp.getHiredate();
        this.sal = emp.getSal();
        this.comm = emp.getComm();

        this.deptno = emp.getDeptno();
        this.dname = dept.getDname();
        this.mark = dept.getMark();
    }

    private long id;
    private String username;
    private String password;
    private String email;
    private String tel;
    private String address;
    private String ename;
    /**
     * 上级
     */
    private long mgr;
    /**
     * 入职
     */
    private Date hiredate;
    /**
     * 工资
     */
    private double sal;
    /**
     * 奖金
     */
    private double comm;
    /**
     * 权限
     */
    private String authoritys;
    private long deptno;
    private String dname;
    private String mark;

}
